function show_edit_comment(comment_id)
{
    $.post('/ajax/articles/get_comment', {comment_id: comment_id},
        function(data) {
            $('#edit-comment').find('input[name = subject]').val(data.comment.subject);
            $('#edit-comment').find('textarea[name = comment]').val(data.comment.comment);
            $('#edit-comment').find('input[name = comment_id]').val(data.comment.comment_id);
            
            $('#edit-comment').dialog({
                modal: true,
                width: 550,
                height: 400,
                buttons: {'Сохранить' : function() {$('#edit-comment form').submit();}, 'Отмена' : function() {$(this).dialog('close');}}
            });  
    }, 'json');
}

function check_comment_form(form)
{
    var comment = $(form).find('textarea[name = comment]').val();
    
    if(comment)
        return true;
    
    $('#comment-form-error').dialog('open');
    
    return false;
}